package com.aspose.cells;

class zace {
   private int g = -1;
   private zace h = null;
   zag[] a;
   private zmj[] i;
   zaf[] b;
   private zacf[] j;
   private zatk[] k;
   zah[] c;
   zah[] d;
   static zaf[] e = new zaf[0];
   static String[] f = new String[]{"c", "w", "h", "ss", "ls", "hc", "vc", "l", "t", "r", "b"};

   void a(int var1) {
      if (this.g != var1 && var1 != 0) {
         if (this.g == 0) {
            this.a = null;
            this.i = null;
            this.b = e;
            this.j = null;
            this.k = null;
            this.c = null;
            this.d = null;
         }

         this.g = var1;
         this.h = zacj.a(this.g);
         if (this.h != null) {
            this.a = a(this.h.a);
         }
      }
   }

   com.aspose.cells.b.a.b.a.ze[] a(float var1, float var2, float var3, float var4) {
      zace var5 = this;
      if (this.g != 0) {
         var5 = this.h;
      }

      zatk[] var6 = var5.k;
      if (var6.length == 0) {
         return null;
      } else {
         com.aspose.cells.b.a.b.a.ze[] var7 = new com.aspose.cells.b.a.b.a.ze[var6.length];
         Object var8 = null;
         Object var9 = null;
         byte[][] var10 = new byte[][]{(byte[])var8};
         double[][] var11 = new double[][]{(double[])var9};
         this.a(var3, var4, var10, var11);
         byte[] var15 = var10[0];
         double[] var16 = var11[0];

         for(int var12 = 0; var12 < var6.length; ++var12) {
            boolean var13 = false;
            boolean[] var14 = new boolean[]{var13};
            var7[var12] = var6[var12].a(this, var16, var15, var1, var2, var3, var4, var14);
            var13 = var14[0];
         }

         return var7;
      }
   }

   float a(double[] var1, byte[] var2, long var3) {
      byte var5 = 0;
      byte[] var6 = new byte[]{var5};
      float var7 = this.a(var1, var2, var3, var6);
      byte var8 = var6[0];
      return var7;
   }

   float a(double[] var1, byte[] var2, long var3, byte[] var5) {
      var5[0] = 0;
      if (var3 < -27273042329600L) {
         var5[0] = var2[(int)(-27273042329600L - var3 - 1L)];
         return (float)var1[(int)(-27273042329600L - var3 - 1L)];
      } else {
         return var3 <= 27273042316900L ? (float)var3 : (float)this.a[(int)(var3 - 27273042316900L - 1L)].a();
      }
   }

   void a(float var1, float var2, byte[][] var3, double[][] var4) {
      zace var5 = this;
      if (this.g != 0) {
         var5 = this.h;
      }

      zacf[] var6 = var5.j;
      var4[0] = new double[var6.length + 11];
      var3[0] = new byte[var6.length + 11];
      var3[0][7] = 1;
      var3[0][8] = 4;
      var3[0][9] = 2;
      var3[0][10] = 8;
      int var7 = 0;
      boolean var8 = true;

      int var9;
      for(var9 = 0; var9 < 11; ++var9) {
         var3[0][var9] = (byte)(var3[0][var9] | 16);
      }

      var4[0][0] = 2.16E7D;
      var4[0][1] = (double)var1;
      var4[0][2] = (double)var2;
      var4[0][3] = var1 > var2 ? (double)var2 : (double)var1;
      var4[0][4] = var1 > var2 ? (double)var1 : (double)var2;
      var4[0][5] = (double)(var1 / 2.0F);
      var4[0][6] = (double)(var2 / 2.0F);
      var4[0][7] = 0.0D;
      var4[0][8] = 0.0D;
      var4[0][9] = (double)var1;
      var4[0][10] = (double)var2;
      var9 = 10;

      while(var9 > 0 && var7 < var4[0].length) {
         int var24 = var7;
         var7 = var4[0].length;
         var9 = 0;

         for(int var10 = Math.max(var24, 11); var10 < var4[0].length; ++var10) {
            if ((var3[0][var10] & 16) != 16) {
               zacf var11 = var6[var10 - 11];
               byte var12 = 0;
               byte var13 = 0;
               byte var14 = 0;
               byte[] var15 = new byte[]{var12};
               double var16 = this.b(var4[0], var3[0], var11.b, var15);
               byte var25 = var15[0];
               byte[] var18 = new byte[]{var13};
               double var19 = this.b(var4[0], var3[0], var11.c, var18);
               byte var26 = var18[0];
               byte[] var21 = new byte[]{var14};
               double var22 = this.b(var4[0], var3[0], var11.d, var21);
               byte var27 = var21[0];
               if (!Double.isNaN(var16) && !Double.isNaN(var19) && !Double.isNaN(var22)) {
                  switch(var11.a) {
                  case 0:
                     var4[0][var10] = var16 * var19 / var22;
                     break;
                  case 1:
                     var4[0][var10] = var16 + var19 - var22;
                     break;
                  case 2:
                     var4[0][var10] = (var16 + var19) / var22;
                     break;
                  case 3:
                     var4[0][var10] = var16 > 0.0D ? var19 : var22;
                     break;
                  case 4:
                     var4[0][var10] = Math.abs(var16);
                     break;
                  case 5:
                     var4[0][var10] = Math.atan2(var19, var16) / 2.9088820866572157E-7D;
                     break;
                  case 6:
                     var4[0][var10] = var16 * Math.cos(Math.atan2(var22, var19));
                     break;
                  case 7:
                     var4[0][var10] = var16 * Math.cos(var19 * 2.9088820866572157E-7D);
                     break;
                  case 8:
                     var4[0][var10] = Math.max(var16, var19);
                     break;
                  case 9:
                     var4[0][var10] = Math.min(var16, var19);
                     break;
                  case 10:
                     var4[0][var10] = Math.sqrt(var16 * var16 + var19 * var19 + var22 * var22);
                     break;
                  case 11:
                     var4[0][var10] = var16 > var19 ? var16 : (var19 > var22 ? var22 : var19);
                     break;
                  case 12:
                     var4[0][var10] = var16 * Math.sin(Math.atan2(var22, var19));
                     break;
                  case 13:
                     var4[0][var10] = var16 * Math.sin(var19 * 2.9088820866572157E-7D);
                     break;
                  case 14:
                     var4[0][var10] = Math.sqrt(var16);
                     break;
                  case 15:
                     var4[0][var10] = var16 * Math.tan(var19 * 2.9088820866572157E-7D);
                     break;
                  case 16:
                     var4[0][var10] = var16;
                  }

                  var3[0][var10] = (byte)(var25 | var26 | var27 | 16);
                  ++var9;
               } else if (var10 < var7) {
                  var7 = var10;
               }
            }
         }
      }

   }

   public zace() {
   }

   public zace(zag[] var1, zacf[] var2, zmj[] var3, zaf[] var4, zatk[] var5, zah var6, zah var7) {
      this.a = var1;
      this.i = var3;
      this.b = var4;
      this.j = var2;
      this.k = var5;
      this.g = 0;
      if (var6 != null) {
         this.c = new zah[1];
         this.c[0] = var6;
         this.d = new zah[1];
         this.d[0] = var7;
      }

   }

   static zag[] a(zag[] var0) {
      zag[] var1 = new zag[var0.length];

      for(int var2 = 0; var2 < var0.length; ++var2) {
         var1[var2] = new zag(var0[var2]);
      }

      return var1;
   }

   float b(double[] var1, byte[] var2, long var3) {
      byte var5 = 0;
      byte[] var6 = new byte[]{var5};
      float var7 = this.a(var1, var2, var3, var6) / 60000.0F;
      byte var8 = var6[0];
      return var7;
   }

   private double b(double[] var1, byte[] var2, long var3, byte[] var5) {
      var5[0] = 0;
      if (var3 > 27273042316900L) {
         return (double)this.a[(int)(var3 - 27273042316900L - 1L)].a();
      } else if (var3 < -27273042329600L) {
         int var6 = (int)(-27273042329600L - var3 - 1L);
         if ((var2[var6] & 16) == 16) {
            var5[0] = var2[var6];
            return var1[var6];
         } else {
            return Double.NaN;
         }
      } else {
         return (double)var3;
      }
   }
}
